/*******************************************************************************
* FILE      : my_types.h                                                       *
* PURPOSE   : declaration of the fixed-point types used in the JPEG code       *
* AUTHOR    : Yves Vanderperren                                                *
*******************************************************************************/

#ifndef MY_TYPES_H
#define MY_TYPES_H

// Comment the following line in order to compile in floating-point mode.
// Uncomment the following line in order to compile in fixed-point mode.
#define FINITE

#include "fx_types.h"

// Declare next your data types, which will be replaced by the corresponding 
// floating- or fixed-point type.
//
// Syntax:
//   FX_DOUBLE(wl, iwl, q_mode, o_mode)  signed   fixed or double
//   UFX_DOUBLE(wl, iwl, q_mode, o_mode) unsigned fixed or double
//   FX_FLOAT(wl, iwl, q_mode, o_mode)   signed   fixed or float
//   UFX_FLOAT(wl, iwl, q_mode, o_mode)  unsigned fixed or float
//   FX_CHAR(q_mode, o_mode)             signed   8-bits fixed or char
//   UFX_CHAR(q_mode, o_mode)            unsigned 8-bits fixed or char
//   FX_INT(iwl, q_mode, o_mode)         signed   fixed or int
//   UFX_INT(iwl, q_mode, o_mode)        unsigned fixed or int
//   FX_SHORT(iwl, q_mode, o_mode)       signed   fixed or short
//   UFX_SHORT(iwl, q_mode, o_mode)      unsigned fixed or short

// examples
#define D_WHATEVER   FX_FLOAT(8,2,SC_TRN,SC_WRAP)
#define D_MY_CHAR    FX_CHAR(SC_TRN,SC_WRAP)
#define D_MY_UCHAR   UFX_CHAR(SC_TRN,SC_WRAP)
#define D_MY_INT     FX_INT(8,SC_TRN,SC_WRAP)
#define D_MY_UINT    UFX_INT(8,SC_TRN,SC_WRAP)
#define D_MY_SHORT   FX_SHORT(8,SC_TRN,SC_WRAP)
#define D_MY_USHORT  UFX_SHORT(8,SC_TRN,SC_WRAP)
#define D_MY_DOUBLE  FX_DOUBLE(7,2,SC_TRN,SC_WRAP)
#define D_MY_UDOUBLE UFX_DOUBLE(7,2,SC_TRN,SC_WRAP)
#define D_MY_FLOAT   FX_FLOAT(7,1,SC_TRN,SC_WRAP)
#define D_MY_UFLOAT  UFX_FLOAT(7,1,SC_TRN,SC_WRAP)

/////////////////////////////////////////////////
// INSERT HERE YOUR OWN DEFINITIONS

#define D_PIXEL	     	UFX_CHAR(SC_TRN, SC_WRAP)
#define D_RGBCOEFF   	FX_FLOAT(8,1,SC_TRN,SC_WRAP)
#define D_BIAS       	UFX_INT(9,SC_TRN, SC_WRAP)
#define D_CONST      	UFX_FLOAT(16,1,SC_TRN, SC_WRAP)
#define D_DCT        	FX_INT(15, SC_TRN, SC_WRAP) 
#define D_DCT13      	FX_INT(13, SC_TRN, SC_WRAP) 
#define D_QUANT       	UFX_FLOAT(16,1, SC_TRN, SC_WRAP) 
#define D_QUANT_TABLE   UFX_INT(7, SC_TRN, SC_WRAP) 
#define D_CONSTQ      	UFX_FLOAT(16,1,SC_TRN, SC_WRAP)
#define D_QUANT_OUT     FX_INT(8, SC_TRN, SC_WRAP) 
#define D_HUF_VAL	UFX_INT(16,SC_TRN, SC_WRAP)
#define D_HUF_BITS	UFX_INT(5,SC_TRN, SC_WRAP)
/////////////////////////////////////////////////

#endif
